<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../semantic/dist/semantic.min.css">
    <title>semantic-progress</title>
    <style></style>
</head>

<body>

    <div class="ui container">

        <div class="ui header dividing">Progress</div>
        <div class="ui progress">
            <div class="bar" style="width: 30%;">
                <div class="progress">30%</div>
            </div>
            <div class="label">上传文件</div>
        </div>

        <div class="ui divider"></div>

        <div class="ui progress test" data-percent="60">
            <div class="bar">
                <div class="progress"></div>
            </div>
            <div class="label">上传文件</div>
        </div>

        <div class="ui divider"></div>

        <div class="ui progress total">
            <div class="bar">
                <div class="progress"></div>
            </div>
            <div class="label">上传文件</div>
        </div>


    </div>

    <script src="../../node_modules/jquery/dist/jquery.min.js"></script>
    <script src="../../semantic/dist/semantic.min.js"></script>
    <script>
    // 可以用data-percent来设置，也可以直接像我下面这样来设置
    $('.ui.progress.test').progress({
        percent: 90
    });
    $('.ui.progress.total').progress({
        total: 3,
        text: {
            active: '{total} 张图片，已上传 {value} 张',
            success: '成功上传了 {total} 张图片'
        }
    });
    var count = 0;
    var a = setInterval(function(){
        $('.ui.progress.total').progress('increment');
        count++;
        if ( 3 == count )
            clearInterval(a);
    }, 1000)
    </script>
</body>

</html>
